package tech.aichan.AiQA.model.entity.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author mengyu
 * @date 2024/03/04 19:44
 */
@Data
//@Document(indexName = "item") TODO
public class ItemES {
    @Id
    @Field(type = FieldType.Long)
    private Long id;
    // TODO 智能切分词条 可以切换(ik_max_word/ik_smart)
    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word",store = true,type = FieldType.Text,copyTo = "all")
    private String itemName;
    @Field(analyzer = "ik_smart",searchAnalyzer = "ik_smart",store = true,type = FieldType.Text,copyTo = "all")
    private String tags;
    @Field(analyzer = "ik_smart",searchAnalyzer = "ik_smart",store = true,type = FieldType.Text)
    private String all;
    @Field(store = true,type = FieldType.Double)
    private Double price;
    @Field(store = true,type = FieldType.Date)
    private Date createTime;
}
